<template>
  <div class="wfull">
    <a-form :labelCol="{ span: 6 }" :wrapperCol="{ span: 14 }">
      <a-form-item label="轮播图名称" required>
        <ZgInput v-model="obj.name"></ZgInput>
      </a-form-item>
      <a-form-item label="切换速度" required>
        <ZgNumber v-model="obj.speed" :min="1" :max="8" :width="120" ></ZgNumber>&nbsp;秒
      </a-form-item>
      <a-form-item label="状态" required>
        <ZgSwitch v-model="obj.isUse" :text="['启用','禁用']" :width="120" ></ZgSwitch>
      </a-form-item>
    </a-form>
  </div>
</template>
<script>
export default {
  data () {
    return {
      obj: {
        name: '',
        speed: 1,
        isUse: false
      }
    }
  },
  methods: {
    save () {
      if (this.obj.name.length === 0) {
        return this.$result.error('请输入轮播图名称')
      }
      return this.$result.ok(Object.assign({}, this.obj))
    }
  }
}
</script>

<style lang="scss" scoped>
</style>
